export default {
  data() {
    return {
      page: {
        currentPage: 1,
        pageSize: 20,
        total: 0,
      },
      query: {},
      form: {},
    };
  },
  computed: {
    params() {
      const page = {
        pageNo: this.page.currentPage,
        pageSize: this.page.pageSize,
      };
      return Object.assign(page, this.query);
    },
  },
  created() {},
  methods: {
    // getParams() {
    //   const page = {
    //     pageNo: this.page.currentPage,
    //     pageSize: this.page.pageSize,
    //   };
    //   return Object.assign(page, this.query);
    // },
    // rowLoad() {
    //   this.onPage()
    // },
    // rowSave(row, done, loading) {
    //   this.onAdd(row)
    //   this.rowLoad(this.params);
    //   loading();
    //   done();
    // },
    currentChange(currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange(pageSize) {
      this.page.pageSize = pageSize;
    },
    searchReset() {
      this.query = {};
      this.page.currentPage = 1;
      this.rowLoad(this.page);
    },
    searchChange(params, done) {
      this.page.currentPage = 1;
      this.query = params;
      this.rowLoad(this.page);
      done();
    },
  },
};
